﻿using System.Collections.Generic;
using System.Linq;

namespace MRGSP.SurveyMaster.Core.Model
{
    public class Question
    {
        public Question()
        {
            Children = Enumerable.Empty<Question>();
        }

        public long Id { set; get; }
        public long SurveyId { get; set; }
        public long? ParentId { get; set; }
        public ControlType Type
        {
            get { return (ControlType) TypeId; }
            set { TypeId = (byte) value; }
        }
        public byte TypeId { get; set; }
        public string Text { get; set; }
        public object Value { get; set; }
        public bool Mandatory { get; set; }
        public bool Red { get; set; }
        public bool Green { get; set; }
        public Question Parent { get; set; }
        public IEnumerable<Question> Children { get; set; }
        public long ColumnId { get; set; }
    }
}